import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { InternetCelebrityGroupRelaIcInfo } from './internetCelebrityGroupRelaIcInfo.entity';

@Injectable()
export class InternetCelebrityGroupRelaIcInfoService {
  constructor(
    @InjectRepository(InternetCelebrityGroupRelaIcInfo)
    private repository: Repository<InternetCelebrityGroupRelaIcInfo>,
  ) {}

  findAll(): Promise<InternetCelebrityGroupRelaIcInfo[]> {
    return this.repository.find();
  }

  findOne(id: any): Promise<InternetCelebrityGroupRelaIcInfo> {
    return this.repository.findOne(id);
  }

  async remove(id: number): Promise<void> {
    await this.repository.delete(id);
  }

  async create(cats: InternetCelebrityGroupRelaIcInfo): Promise<void> {
    await this.repository.save(cats);
  }
}
